<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.box1{
				border:10px solid pink;
				
				/*overflow:hidden;*/
			}
			.box2{
				width: 100px;
				height: 100px;
				background-color: #bfa;
				float: left;
			}
			.box3{
				clear: both;
			}
			
			.box1::after{
				content:"";
				display: block;
				clear: both;
				
				/*最完美的方案：通过给box1添加伪元素，after是行内元素所以需要转换成块级元素单独占一行*/
			}
		</style>
	</head>
	<body>
		<div class="box1">
			<div class="box2">
				<div class="box3"></div>
			</div>
		</div>
	</body>
</html>
